// 用于主页面通用内容
import Main from '@/views/main.vue';
// 用于应用市场页面的内容
import MarketMain from '@/views/market-main.vue';

export default {
	path: '/',
	name: 'marketRouter',
	redirect: '/home',
	meta: {
		active: 'app'
	},
	component: Main,
	children: [
		{
			path: '/app/market/coupon',
			name: 'app_market_coupon',
			redirect: '/app/market/coupon/index',
			meta: {
				title: '优惠券',
				icon: 'coupon',
				describe: '向客户发送优惠券，多种类型优惠券均有'
			},
			component: MarketMain,
			children: [
				{
					path: 'index',
	    			name: 'app_market_coupon_index',
	    			meta: {
	    				title: '优惠券列表'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/coupon/index.vue'], resolve)
					}
				},
				{
					path: 'edit',
	    			name: 'app_market_coupon_edit',
	    			meta: {
	    				title: '优惠券编辑',
	    				active: 'app_market_coupon_index'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/coupon/edit.vue'], resolve)
					}
				},
		    	{
		    		path: 'code',
		        	name: 'app_market_coupon_code',
		        	meta: {
		        		title: '优惠券券码',
					    active: 'app_market_coupon_index'
		        	},
		        	component: resolve => {
			        	require(['@/views/app/market/coupon/code.vue'], resolve)
			        }
		    	},
				{
					path: 'set',
	    			name: 'app_market_coupon_set',
	    			meta: {
	    				title: '优惠券设置'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/coupon/set.vue'], resolve)
					}
				}
			]
		},
		{
			path: '/app/market/fullReduceGift',
			name: 'app_market_fullReduceGift',
			redirect: '/app/market/fullReduceGift/index',
			meta: {
				title: '满减满赠',
				icon: 'freduction',
				describe: '订单满足一定条件享受优惠活动'
			},
			component: MarketMain,
			children: [
				{
					path: 'index',
	    			name: 'app_market_fullReduceGift_index',
	    			meta: {
	    				title: '满减满赠'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/fullReduceGift/index.vue'], resolve)
					}
				},
				{
					path: 'edit',
	    			name: 'app_market_fullReduceGift_edit',
	    			meta: {
	    				title: '满减满赠编辑',
	    				active: 'app_market_fullReduceGift_index'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/fullReduceGift/edit.vue'], resolve)
					}
				}
			]
		},
		{
			path: '/app/market/flashSale',
			name: 'app_market_flashSale',
			redirect: '/app/market/flashSale/index',
			meta: {
				title: '限时促销',
				icon: 'flash-sale',
				describe: '设置商品在规定时间内的优惠活动'
			},
			component: MarketMain,
			children: [
				{
					path: 'index',
	    			name: 'app_market_flashSale_index',
	    			meta: {
	    				title: '限时促销'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/flashSale/index.vue'], resolve)
					}
				},
				{
					path: 'edit',
	    			name: 'app_market_flashSale_edit',
	    			meta: {
	    				title: '限时促销编辑',
	    				active: 'app_market_flashSale_index'
	    			},
	    			component: resolve => {
						require(['@/views/app/market/flashSale/edit.vue'], resolve)
					}
				}
			]
		}
	]
}